<form class="layui-form layui-form-pane edit-form">
    <div class="layui-form-item">
        <label class="layui-form-label">
            用户角色
        </label>
        <div class="layui-input-block">
            <select lay-verify="required" name="role">
                {foreach $roles as $k=>$v}
                {if $k == $data['role']}
                <option selected="selected" value="{$k}">
                    {$v}
                </option>
                {else}
                <option value="{$k}">
                    {$v}
                </option>
                {/if}
                {/foreach}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">
            账号
        </label>
        <div class="layui-input-block">
            <input autocomplete="off" class="layui-input" lay-verify="required" name="username" type="text" value="{$data['username']}"/>
        </div>
    </div>
    {if !$data['id']}
    <div class="layui-form-item">
        <label class="layui-form-label">
            密码
        </label>
        <div class="layui-input-block">
            <input autocomplete="off" class="layui-input" lay-verify="required" name="newpwd" type="password"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">
            确认密码
        </label>
        <div class="layui-input-block">
            <input autocomplete="off" class="layui-input" lay-verify="required" name="cfmpwd" type="password"/>
        </div>
    </div>
    {/if}
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-filter="adminform" lay-submit="">
                保存
            </button>
            <button class="layui-btn layui-btn-primary layui-btn-cancel" type="button">
                取消
            </button>
        </div>
    </div>
</form>
{load href="__js__/md5.js,__module__/admin/admin/edit.js" /}
